package baseFx.tests.common.caching.redis;

import baseFx.common.caching.redis.RedisCache;
import redis.clients.jedis.JedisPool;

import java.util.UUID;

public class TestRedisCache {
    public static void main(String[] args) {
        TestRedisCache instance = new TestRedisCache();
        instance.run();
    }

    public void run() {
        JedisPool pool = new JedisPool();
        RedisCache cache = new RedisCache(pool);
        A a = new A(UUID.randomUUID().toString());
        cache.save("aaa", a, 10);
        System.out.println(((A) cache.get("aaa")).str);
    }

    public static class A {
        public String str;

        public A() {

        }

        public A(String s) {
            str = s;
        }
    }
}
